<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="layui/css/layui.css" />
<script type="text/javascript" src="layui/layui.js"></script>
</head>
<body>
	<form class="layui-form" onsubmit="false">
	<div class="layui-form-item" style="margin-top: 20px">
			<label class="layui-form-label"><span style="color: red;">*</span>ID：</label>
			<div class="layui-input-inline" style="width: 350px">
				<input type="text" name="addid" id="addid" required
					lay-verify="required" placeholder="" autocomplete="off"
					class="layui-input">
			</div>
		</div>
		<div class="layui-form-item" style="margin-top: 20px">
			<label class="layui-form-label"><span style="color: red;">*</span>省：</label>
			<div class="layui-input-inline" style="width: 350px">
			<select name="addprovince" id="addprovince" class="layui-input"
					lay-verify="required">
					<option value="">请选择</option>
					<option value="河南省">河南省</option>
					<option value="河北省">河北省</option>
					<option value="山东省">山东省</option>
					<option value="广东省">广东省</option>
					<option value="湖南省">湖南省</option>
					<option value="云南省">云南省</option>
				</select>
			</div>
		</div>
		<div class="layui-form-item" style="margin-top: 20px">
			<label class="layui-form-label"><span style="color: red;">*</span>市：</label>
			<div class="layui-input-inline" style="width: 350px">
			<select name="addcity" id="addcity" class="layui-input"
					lay-verify="required">
					<option value="">请选择</option>
					<option value="驻马店市">驻马店市</option>
					<option value="保定市">保定市</option>
					<option value="烟台市">烟台市</option>
					<option value="广州市">广州市</option>
					<option value="长沙市">长沙市</option>
					<option value="昆明市">昆明市</option>
				</select>
			</div>
		</div>
		<div class="layui-form-item" style="margin-top: 20px">
			<label class="layui-form-label"><span style="color: red;">*</span>区（县）：</label>
			<div class="layui-input-inline" style="width: 350px">
			<select name="adddistinct" id="adddistinct" class="layui-input"
					lay-verify="required">
					<option value="">请选择</option>
					<option value="西平县">西平县</option>
					<option value="竞秀区">竞秀区</option>
					<option value="牟平区">牟平区</option>
					<option value="白云区">白云区</option>
					<option value="岳麓区">岳麓区</option>
					<option value="盘龙区">盘龙区</option>
				</select>
			</div>
		</div>
		<div class="layui-form-item" style="margin-top: 20px">
			<label class="layui-form-label"><span style="color: red;">*</span>收货人：</label>
			<div class="layui-input-inline" style="width: 350px">
				<input type="text" name="Uharvest_people" id="Uharvest_people" required
					lay-verify="required" placeholder="" autocomplete="off"
					class="layui-input">
			</div>
		</div>
		<div class="layui-form-item" style="margin-top: 20px">
			<label class="layui-form-label"><span style="color: red;">*</span>联系电话：</label>
			<div class="layui-input-inline" style="width: 350px">
				<input type="text" name="Uconsignee" id="Uconsignee" required
					lay-verify="required" placeholder="" autocomplete="off"
					class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-btn-container" style="text-align: center;">
				<button class="layui-btn" lay-submit lay-filter="formDemo">编辑</button>
			</div>
		</div>
	</form>

	<script>
		//Demo
		layui.use(['form'], function() {
			var form = layui.form;
			var $ = layui.jquery;
			//监听提交
			form.on('submit(formDemo)', function(data) {
				var d = data.field;//表单中的数据，定义一个对象来接收
				var url = '/shoppingsix/address_update';
				$.post(url, d, function(data) {
					if (data.count > 0) {
						console.log(data);
						var index = parent.layer.getFrameIndex(window.name);//获取当前窗口的name
						parent.layer.close(index);//关闭窗口
					}
				}, "json");
				return false;
			});
		});
	</script>

</body>
</html>